class Singleton{
    //唯一实例的本体
    private static Singleton instance=new Singleton();
    //获取到实力的方法
    public static Singleton get(){
        return instance;
    }
    //禁止外部new实例
    private Singleton(){}
}
public class demo03 {
    //单例模式
    public static void main(String[] args) {
        Singleton s1=Singleton.get();
        Singleton s2=Singleton.get();

        System.out.println(s1==s2);
    }
}
